#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
//	system("start https://www.lanqiao.cn/problems/614/learning/");

    vector<int> days = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

    int y = 2000, m = 5, d = 4;

    if((y % 4 == 0 && y % 100) || (y % 400 == 0))
        days[2] = 29;

    int ans = 0;
    for(int i = 1; i <= 12; i++) {
        for(int j = 1; j <= days[i]; j++) {
            ans++;
            if(i == m && j == d) {
                cout << ans;
                return 0;
            }
        }
    }

    return 0;
}

